<?

/*
*
*   Excalibur Content Management System
*   Copyright © 2008 Egor "Sontan" Kuryanovich
*
*   Based on Explay Engine v2.0 by Golovdinov Alexander
*
*   Official site: www.excms.ru
*   Contact e-mail: support@excms.ru
*
*   GNU General Public License original source:
*   http://www.gnu.org/licenses/gpl-3.0.html
*
*/


header('Content-type: text/html; charset=utf-8');

if ($_GET['save'] == "save_true") {
	session_start ();
	
	if ($_SESSION['admin_block_file'] != "include/ajax/site.php") $_SESSION['admin_block_file'] = "include/ajax/site.php";

	include "../../engine/settings.php";
	include "../../engine/mysql.class.php";
	
	$db = new DB($server, $dbusername, $dbpassword, $dbname);
	$db->connect();
}

$arts = $db->num_rows ($db->query ("SELECT art_id FROM ".DB_PEREFIX."_articles"));
$cats = $db->num_rows ($db->query ("SELECT cat_id FROM ".DB_PEREFIX."_art_category"));
$users = $db->num_rows ($db->query ("SELECT user_id FROM ".DB_PEREFIX."_users"));
$com = $db->num_rows ($db->query ("SELECT com_id FROM ".DB_PEREFIX."_comments"));
$ban = $db->num_rows ($db->query ("SELECT * FROM ".DB_PEREFIX."_blacklist"));
$uban = $db->num_rows ($db->query ("SELECT * FROM ".DB_PEREFIX."_users WHERE user_ban = 'on'"));

$query = $db->query ("SHOW TABLE STATUS FROM ".$dbname);
while ($row = $db->fetch_array ($query)) {
	$size += $row['Data_length'] + $row['Index_length'];
}
$size = $size / 1024;
$size = round ($size, 1)." Кб";

print "<table width=\"100%\" class=\"main_text\" border=\"0\" cellspacing=\"0\" cellpadding=\"2\">
<tr><td width=\"70%\">Статей:</td><td>$arts</td></tr>
<tr><td>Разделов статей:</td><td>$cats</td></tr>
<tr><td>Пользователей:</td><td>$users</td></tr>
<tr><td>Комментариев:</td><td>$com</td></tr>
<tr><td><font color=\"red\">Забаненых ip:</td><td>$ban</font></td></tr>
<tr><td><font color=\"red\">Забаненых польз.:</td><td>$uban</font></td></tr>
<tr><td colspan=\"2\">&nbsp;</td></tr>
<tr><td>Размер БД:</td><td>$size</td></tr>
</table>";

?>
